const db = require('./db').clien;
const app = require('./app');//?生成路由实例
db.connect(function (err) {//?连接数据库
    if (err) console.error('连接错误：' + err);
    else console.log("2数据库连接成功");
})
const html_=require('./web_html')//?网页接口
html_(app,db)//?页面路由

const picture=require('./picture')//?图片接口
picture(app,db)//?图片路由

const picture_add=require('./picture_add')//?保存图片接口
picture_add(app,db)//?图片添加路由

const recipe_operation=require('./recipe_operation')//?菜谱操作接口
recipe_operation(app,db)//?菜谱操作路由

const user_operation=require('./user_operation')//?用户操作
user_operation(app,db)//?用户操作路由

const static_file=require('./Static_file')//?静态文件响应
static_file(app,db)//?文件响应路由

const admin_operation=require('./admin_server/admin_operation')//?管理员操作
admin_operation(app,db)

const admin_html=require('./admin_server/admin_html')//?管理员页面响应
admin_html(app,db)

const admin_userop=require('./admin_server/admin_userop')//?管理用户操作
admin_userop(app,db)

const admin_userrecipe=require('./admin_server/admin_userrecipe')//?管理用户菜单
admin_userrecipe(app,db)

app.listen(52273, function () {
    console.log('服务启动');
})